From fe928a0a7fb5761c0181f0898260067d7a3602f4 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 30 Apr 2015 11:25:01 -0700 Subject: [PATCH] SearchHighlighter: Stop checking for existence of "wfCite" function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit …and instead look for the Cite class. Not really any better, but it will let us eliminate the "wfCite" global function. Change-Id: Icdf82cb9771e6ae9bcaa6a02629b1b11f840a5c6 --- includes/search/SearchHighlighter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/search/SearchHighlighter.php b/includes/search/SearchHighlighter.php index 223a2fe4e7..5087e8d585 100644 --- a/includes/search/SearchHighlighter.php +++ b/includes/search/SearchHighlighter.php @@ -58,7 +58,8 @@ class SearchHighlighter { 3 => "/(\n\\{\\|)|(\n\\|\\})/" ); // table // @todo FIXME: This should prolly be a hook or something - if ( function_exists( 'wfCite' ) ) { + // instead of hardcoding a class name from the Cite extension + if ( class_exists( 'Cite' ) ) { $spat .= '|()'; // references via cite extension $endPatterns[4] = '/()|(<\/ref>)/'; } -- 2.20.1